#include<iostream>
#include<cmath>
using namespace std;

#include<Eigen/Core>
#include<Eigen/Geometry>

int main(int argc, char** argv)
{
    Eigen::Matrix3d rotation_matrix = Eigen::Matrix3d::Identity();
    Eigen::Vector3d v(1, 2, 0);
    Eigen::Vector3d w(2, -3, 1);
    Eigen::AngleAxisd rotation_vector1 ( M_PI/6, Eigen::Vector3d ( 0,0,1 )); // 沿Z B轴旋转30度
    rotation_matrix = rotation_vector1.toRotationMatrix();
    v = rotation_matrix * v + w;
    Eigen::AngleAxisd rotation_vector2 ( M_PI/4, Eigen::Vector3d ( 0,1,0 )); // 沿Y A轴旋转45度
    Eigen::AngleAxisd rotation_vector3 ( M_PI/3, Eigen::Vector3d ( 1,0,0 )); // 沿X B轴旋转60度
    cout.precision(3); //浮点数的精度
    // 计算旋转矩阵
    rotation_matrix = rotation_vector2.toRotationMatrix() * rotation_vector3.toRotationMatrix();
    Eigen::Vector3d v_rotated = rotation_matrix * v;
    cout<< v_rotated <<endl;
}



